<?php
/*
	[BuyPg] (C) 2010-2011 Buypg
	$Id: UserModel.class.php 2011-5-10 9:42:58 wufujun $
 */
if (!defined('THINK_PATH')) {
	exit('Access Denied');
}

class UserModel extends Model{
	//自动验证
	protected $_validate = array(
		array('user_nickname','require','用户名不能为空',0),
		array('user_nickname','','用户已经存在！',0,'unique',1), 
		array('user_password' ,'require','密码不能为空',0),
		array('repassword','user_password','两次输入密码不同',0,'confirm'), 
		array('user_truename','require','真实姓名不能为空',0),
		array('user_email','require','邮箱不能为空',0), 
		array('user_email','email','邮箱格式错误',2), 
		array('user_que','require','提示问题不能为空',0),
		array('user_ans','require','回答问题不能为空',0),
	);
	//自动填充
	protected $_auto = array(
		array('user_password','sha1',self::MODEL_INSERT,'function'),
		array('user_cdate','getTimeToStr',self::MODEL_INSERT,'function'),
		array('user_lastdate','getTimeToStr',Model:: MODEL_BOTH,'function'),
		array('user_cip','get_client_ip',self::MODEL_INSERT,'function'),
		array('status','1',self::MODEL_INSERT,'string')
	);
	
}
?>